package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AcCustodialUnitMapper;
import com.ruoyi.system.domain.AcCustodialUnit;
import com.ruoyi.system.service.IAcCustodialUnitService;

/**
 * 资产看管单元Service业务层处理
 *
 * @author ruoyi
 * @date 2025-04-07
 */
@Service
public class AcCustodialUnitServiceImpl implements IAcCustodialUnitService
{
    @Autowired
    private AcCustodialUnitMapper acCustodialUnitMapper;

    /**
     * 查询资产看管单元
     *
     * @param unitId 资产看管单元主键
     * @return 资产看管单元
     */
    @Override
    public AcCustodialUnit selectAcCustodialUnitByUnitId(String unitId)
    {
        return acCustodialUnitMapper.selectAcCustodialUnitByUnitId(unitId);
    }

    /**
     * 查询资产看管单元列表
     *
     * @param acCustodialUnit 资产看管单元
     * @return 资产看管单元
     */
    @Override
    public List<AcCustodialUnit> selectAcCustodialUnitList(AcCustodialUnit acCustodialUnit)
    {
        return acCustodialUnitMapper.selectAcCustodialUnitList(acCustodialUnit);
    }

    /**
     * 新增资产看管单元
     *
     * @param acCustodialUnit 资产看管单元
     * @return 结果
     */
    @Override
    public int insertAcCustodialUnit(AcCustodialUnit acCustodialUnit)
    {
        acCustodialUnit.setCreateTime(DateUtils.getNowDate());
        return acCustodialUnitMapper.insertAcCustodialUnit(acCustodialUnit);
    }

    /**
     * 修改资产看管单元
     *
     * @param acCustodialUnit 资产看管单元
     * @return 结果
     */
    @Override
    public int updateAcCustodialUnit(AcCustodialUnit acCustodialUnit)
    {
        acCustodialUnit.setUpdateTime(DateUtils.getNowDate());
        return acCustodialUnitMapper.updateAcCustodialUnit(acCustodialUnit);
    }

    /**
     * 批量删除资产看管单元
     *
     * @param unitIds 需要删除的资产看管单元主键
     * @return 结果
     */
    @Override
    public int deleteAcCustodialUnitByUnitIds(String[] unitIds)
    {
        return acCustodialUnitMapper.deleteAcCustodialUnitByUnitIds(unitIds);
    }

    /**
     * 删除资产看管单元信息
     *
     * @param unitId 资产看管单元主键
     * @return 结果
     */
    @Override
    public int deleteAcCustodialUnitByUnitId(String unitId)
    {
        return acCustodialUnitMapper.deleteAcCustodialUnitByUnitId(unitId);
    }
}
